﻿using Dapper;
using System;
using BCEntity.Common.Solution.WebsiteSolution;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Common.Solution.WebsiteSolution
{
    /// <summary>
    /// 官网解决方案
    /// </summary>
    public interface IWebsiteSolutionData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="websiteSolutionId">官网解决方案Id</param>
        Task<bool> Exists(int websiteSolutionId);
        /// <summary>
        /// 增加官网解决方案
        /// </summary>
        /// <param name="entity">官网解决方案信息</param>
        Task<WebsiteSolutionEntity> Add(WebsiteSolutionEntity entity);
        /// <summary>
        /// 更新官网解决方案
        /// </summary>
        /// <param name="entity">官网解决方案信息</param>
        Task<WebsiteSolutionEntity> Update(WebsiteSolutionEntity entity);
        /// <summary>
        /// 删除官网解决方案
        /// </summary>
        /// <param name="websiteSolutionId">官网解决方案Id</param>
        Task<bool> Delete(int websiteSolutionId);
        /// <summary>
        /// 获取官网解决方案
        /// </summary>
        /// <param name="websiteSolutionId">官网解决方案Id</param>
        Task<WebsiteSolutionEntity> GetEntity(int websiteSolutionId);
        /// <summary>
        /// 获取官网解决方案列表
        /// </summary>
        Task<IEnumerable<WebsiteSolutionEntity>> GetList();
        /// <summary>
		/// 获取官网解决方案分页列表
		/// </summary>
		/// <param name="enabled">启用</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<WebsiteSolutionEntity>, int)> Query(bool? enabled, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 启用官网解决方案
        /// </summary>
        /// <param name="websiteSolutionId">官网解决方案Id</param>
        Task<bool> Enabled(int websiteSolutionId);
        /// <summary>
        /// 禁用官网解决方案
        /// </summary>
        /// <param name="websiteSolutionId">官网解决方案Id</param>
        Task<bool> Disabled(int websiteSolutionId);
        #endregion  成员方法
    }


}